<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改天气')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-weather-edit" th:object="${weather}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">国家编码：</label>
                <div class="col-sm-8">
                    <input name="countryCode" th:field="*{countryCode}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">省份编码：</label>
                <div class="col-sm-8">
                    <input name="provinceCode" th:field="*{provinceCode}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">城市编码：</label>
                <div class="col-sm-8">
                    <input name="cityCode" th:field="*{cityCode}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">当前日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="date" th:value="${#dates.format(weather.date, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">当前星期：</label>
                <div class="col-sm-8">
                    <input name="week" th:field="*{week}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">实时天气情况：</label>
                <div class="col-sm-8">
                    <input name="wea" th:field="*{wea}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">当前星期：</label>
                <div class="col-sm-8">
                    <input name="weaImg" th:field="*{weaImg}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">实时温度：</label>
                <div class="col-sm-8">
                    <input name="tem" th:field="*{tem}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">高温：</label>
                <div class="col-sm-8">
                    <input name="tem1" th:field="*{tem1}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">低温：</label>
                <div class="col-sm-8">
                    <input name="tem2" th:field="*{tem2}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">风向：</label>
                <div class="col-sm-8">
                    <input name="win" th:field="*{win}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">风力等级：</label>
                <div class="col-sm-8">
                    <input name="winSpeed" th:field="*{winSpeed}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">风速：</label>
                <div class="col-sm-8">
                    <input name="winMeter" th:field="*{winMeter}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">湿度：</label>
                <div class="col-sm-8">
                    <input name="humidity" th:field="*{humidity}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">能见度：</label>
                <div class="col-sm-8">
                    <input name="visibility" th:field="*{visibility}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">气压：</label>
                <div class="col-sm-8">
                    <input name="pressure" th:field="*{pressure}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">空气质量：</label>
                <div class="col-sm-8">
                    <input name="air" th:field="*{air}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">pm2.5：</label>
                <div class="col-sm-8">
                    <input name="airPm25" th:field="*{airPm25}" class="form-control" type="text">
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "product/weather";
        $("#form-weather-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/saveOrUpdate", $('#form-weather-edit').serialize());
            }
        }

        $("input[name='date']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>